import { Injectable } from '@angular/core';
import {Observable, Subject} from 'rxjs';
import {HttpClient} from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class LayoutService {

  constructor(private http: HttpClient) { }

  public system: Subject<any> = new Subject<any>(); // 加载动画控制

/*************** 省级数据获取 ***************/
 public getProvinceInfo(params?: {}): Observable<any> {
    return this.http.post(`/getWarn`, params);
  }

  /*************** 市级数据获取 ***************/
  public getArea(params?: {}): Observable<any> {
    return this.http.post(`/getArea`, params);
  }

  /*************** 县级数据获取 ***************/
  public getCounty(params?: {}): Observable<any> {
    return this.http.post(`/getAreaWarn`, params);
  }

  /*************** 演化一级数据获取 ***************/
  public getEvolution(params?: {}): Observable<any> {
    return this.http.post(`/getEvolution`, params);
  }

  /*************** 演化二级数据获取 ***************/
  public getEvolutionDetail(params?: {}): Observable<any> {
    return this.http.post(`/getEvolutionDetail`, params);
  }

  /*************** 柱状图获取 ***************/
  public getBar(params?: {}): Observable<any> {
    return this.http.post(`/getDisease`, params);
  }

  /*************** 区域信息 ***************/
  public getAreaId(params?: {}): Observable<any> {
    return this.http.post(`/getAreaId`, params);
  }

  /*************** 区域信息 ***************/
  public getSystem(params?: {}): Observable<any> {
    return this.http.post(`/getSystem`, params);
  }
}
